﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Utilities.QuickSql;
using MySql.Data;

namespace Deviseur_Cs2i_Car
{
    class HTDI
    {
       
        int NumHTDI;
        string LibelleHTDI;

        public HTDI()
        {
        }
        public HTDI(string LibelleHTDI)
        {
            this.LibelleHTDI = LibelleHTDI;
        }
        public HTDI(int NumHTDI, string LibelleHTDI)
        {
            this.NumHTDI = NumHTDI;
            this.LibelleHTDI = LibelleHTDI;
        }
        public HTDI(int NumHTDI)
        {
            this.NumHTDI = NumHTDI;
        }
        public int get_NumHTDI()
        {
            return this.NumHTDI;
        }
        public string get_LibelleHTDI()
        {
            return this.LibelleHTDI;
        }
        public void set_NumHTDI(int NumHTDI)
        {
            this.NumHTDI = NumHTDI;
        }
        public void set_LibelleHTDI(string LibelleHTDI)
        {
            this.LibelleHTDI = LibelleHTDI;
        }
        public void affiche_HTDI()
        {
            Console.WriteLine("Num HTDI : ", this.NumHTDI);
            Console.WriteLine("Libelle HTDI : ", this.LibelleHTDI);
        }
        public void new_HTDI()
        {
            Program.Db.Execute("INSERT INTO HTDI (LibelleHTDI) VALUES ('" + this.LibelleHTDI + "')");
        }
        public void modify_HTDI()
        {
            Program.Db.Execute("UPDATE HTDI SET LibelleHTDI = '" + this.LibelleHTDI + "' WHERE NumHTDI = " + this.NumHTDI + "");
        }
        public void delete_HTDI(int NumHTDI)
        {
            Program.Db.Execute("DELETE FROM HTDI WHERE NumHTDI = " + NumHTDI + "");
        }
        

    }
}
